home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / SCRIPTZ / SUPERSTA.ZIP / supersta.txt
Text File  |  1996-12-29  |  6KB  |  184 lines

  1. ******************************
  2. * The Ultimate Channel stats *
  3. * ========================== *
  4. ******************************
  5.  
  6. Greets 2 u whoever you are;-)
  7.  
  8. Channel statistics have come a looooooong way since giving
  9. ops, non-ops and total ;-)
  10.  
  11. Please find, occupying the few dozen lines below, the Ultimate
  12. channel stats script, including ppl stats and server stats.
  13.  
  14. Small warning, when run this will give you a slight flood in your
  15. status window, cos it has to do, and listen for the results from,
  16. a /whois on everyone in the channel.
  17.  
  18. This lit goes in your alias'
  19.  
  20. /Stats {
  21.   set %statnickcheck on
  22.   write -c c:\servers.txt
  23.   write -c c:\stats.txt
  24.   set %servno 1
  25.   :servstart
  26.   if %servtype [ $+ [ %servno ] ] != $null { 
  27.     set %servtype [ $+ [ %servno ] ] 
  28.     set %servnum [ $+ [ %servno ] ] 
  29.     inc %servno 1
  30.     goto servstart
  31.   }
  32.   else { 
  33.     unset %10op
  34.     unset %10nop
  35.     unset %10away
  36.     unset %10here
  37.     unset %10vnick
  38.     set %pops 0
  39.     set %pnops 0 
  40.     set %paway 0
  41.     set %phere 0
  42.     set %pvnick 0 
  43.     unset %stataddress
  44.     unset %server
  45.     unset %qservernum
  46.     unset %nickletter
  47.     set %statletter 0
  48.     set %anicks 0
  49.     set %hnicks 0
  50.     set %vnicks 0
  51.     set %ircnicks 0
  52.     set %servnum 0
  53.     set %statnick 1
  54.     set %statnickdone 0
  55.     set %statclones 0
  56.     set %hops 0 
  57.     set %avehops 0
  58.     set %myserver $server
  59.     set %nickletter $rand(a,z)
  60.     set %totnick $nick(0,%schan)
  61.     ;set %stattime 0 | timer101 0 1 inc %stattime 1 
  62.     :start
  63.     if %statnick > %totnick halt
  64.     else who $nick(%statnick,%schan)
  65.     inc %statnick 1
  66.     goto start
  67.   }
  68. }
  69.  
  70. So does this
  71.  
  72. /percent {
  73.   %10op = [ $opnick(0,%schan) ] * 100
  74.   %10nop = [ $nopnick(0,%schan) ] * 100
  75.   %10away = [ %anicks ] * 100
  76.   %10here = [ %hnicks ] * 100
  77.   %10vnick = [ %vnicks ] * 100
  78.   %10ircnick = [ %ircnicks ] * 100
  79.   %pops = [ %10op ] / $nick(0,%schan)
  80.   %pnops = [ %10nop ] / $nick(0,%schan)
  81.   %paway = [ %10away ] / $nick(0,%schan)
  82.   %phere = [ %10here ] / $nick(0,%schan)
  83.   %pvnick = [ %10vnick ] / $nick(0,%schan)
  84.   %pircop = [ %10ircnick ] / $nick(0,%schan)
  85.   %avehops =  [ %hops ] / $nick(0,%schan)
  86.   %ratio = $nopnick(0,%schan) / $opnick(0,%schan) 
  87.   set %servno 1 
  88.   :servmsgst
  89.   if %servnum [ $+ [ %servno ] ] != $null {
  90.     set %100serv %servnum [ $+ [ %servno ] ] * 100
  91.     set %servperc [ %100serv ] / $nick(0,%schan)
  92.     unset %writestats
  93.     if %servtype [ $+ [ %servno ] ] = %myserver { 
  94.       write c:\servers.txt Server %servno $+ ) %servnum [ $+ [ %servno ] ] ppl on $token(1,46, %servtype [ $+ [ %servno ] ] ) $+ * ( $+ %servperc $+ [ % ] usage)
  95.     } 
  96.     if %servtype [ $+ [ %servno ] ] != %myserver {
  97.       write c:\servers.txt Server %servno $+ ) %servnum [ $+ [ %servno ] ] ppl on $token(1,46, %servtype [ $+ [ %servno ] ] ) ( $+ %servperc $+ [ % ] usage)
  98.     }
  99.     :nextserv
  100.     inc %servno 1
  101.     goto servmsgst
  102.   }
  103.   if %nickstats = on {
  104.     write c:\stats.txt %schan statistix...
  105.     write c:\stats.txt Tot ------ <ò> [ $nick(0,%schan) ]  
  106.     write c:\stats.txt Ops ------ <ò> [ $opnick(0,%schan) ] ( $+ %pops $+ [ % ] $+ ) 
  107.     write c:\stats.txt Non-ops -- <ò> [ $nopnick(0,%schan) ] ( $+ %pnops $+ [ % ] $+ )
  108.     write c:\stats.txt IRC ops -- <ò> %ircnicks ( $+ %pircop $+ [ % ] $+ ) 
  109.     write c:\stats.txt Op:Non-Op Ratio <ò> 1: $+ %ratio
  110.     write c:\stats.txt Here ----- <ò> %hnicks ( $+ %phere $+ [ % ] $+ ) 
  111.     write c:\stats.txt Away ----- <ò> %anicks ( $+ %paway $+ [ % ] $+ ) 
  112.     write c:\stats.txt Voiced --- <ò> %vnicks ( $+ %pvnick $+ [ % ] $+ )
  113.     write c:\stats.txt Ave Hops - <ò> %avehops 
  114.     write c:\stats.txt Clones --- <ò> %statclones 
  115.     write c:\stats.txt Servers -- <ò> [ $lines(c:\servers.txt) ]
  116.     ;Time to compile <ò> %stattime seconds
  117.     write c:\stats.txt Ppl with an ' %nickletter ' in their nick <ò> %statletter 
  118.     play %schan c:\stats.txt 2000
  119.   }
  120.   if %servmsg = on { 
  121.     msg %schan There are $lines(c:\servers.txt) servers in use on %schan (* denotes my own)
  122.     play %schan c:\servers.txt 2000
  123.   }
  124. }
  125.  
  126. This is how to run 'em, put it in your popups (channel)
  127.  
  128.  
  129. Stat
  130. .Stats:set %servmsg off | set %schan # | set %nickstats on | stats
  131. .Servers:set %servmsg on | set %nickstats off | set %schan # | stats
  132.  
  133. And this whatmajig enjoys spending most of it's time in your RAW
  134. section of your remote. 
  135.  
  136. 352:*: {
  137.   if %statnickcheck = on {
  138.     inc %statnickdone 1
  139.     if g isin $parm7 inc %anicks 1
  140.     if h isin $parm7 inc %hnicks 1
  141.     if + isin $parm7 inc %vnicks 1
  142.     if * isin $parm7 inc %ircnicks 1
  143.     if %nickletter isin $parm6 inc %statletter 1
  144.     set %hops %hops + $parm8
  145.     set %servno 1
  146.     :servstart
  147.     if %servtype [ $+ [ %servno ] ] = $null { 
  148.       set %servtype [ $+ [ %servno ] ] $parm5 
  149.       set %servnum [ $+ [ %servno ] ] 1
  150.       goto chkclones
  151.     }  
  152.     if %servtype [ $+ [ %servno ] ] = $parm5 { 
  153.       inc %servnum [ $+ [ %servno ] ] 1 
  154.       goto chkclones 
  155.     }
  156.     if %servtype [ $+ [ %servno ] ] != $parm5 { inc %servno 1 | goto servstart }
  157.     :chkclones
  158.     if $parm4 !isin %stataddress { set %stataddress %stataddress $parm4 | goto end }
  159.     else inc %statclones 1
  160.     :end
  161.     if %statnickdone = %totnick percent
  162.   }
  163. }
  164.  
  165. And, uhh, thats it really. Damn good use of 137 lines of mIRC script
  166. space if u ask me.....mebbee.
  167.  
  168. mIRC 4.6 at least!!
  169.  
  170. Obviously u can do whattevver you want, but if you include this script in a bot,
  171. I'd appreciate a mention of my nick, and The <ò> Aut0Bot <ò>, cheerz.
  172.  
  173. Make sure listening's 'on'
  174.  
  175. Hi'z to oH_yEaH, Wichita-Guy, ^monty, MEK and sumWOMAN
  176.  
  177. *****************************************************
  178. *  The Ultimate Channel stats, part of The Aut0Bot, *
  179. *   ⌐1996 written by Phillip Renfield aka _Qu^rtZ_  *
  180. *****************************************************
  181.  
  182. ps - this only works properly on DALnet
  183.  
  184.